package me.liuyu.ymall.common.message.email;

import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Controller;

/**
 * @Author liuyu E-mail: liuyu2783@163.com
 * @Date 2018/6/23 15:02
 * @Descrption
 * @Modified By
 */
@Controller
@EnableAutoConfiguration
public class EmailListener {
    public static Logger logger = LoggerFactory.getLogger(EmailListener.class);

    @KafkaListener(id = "t2", topics = "test")
    public void listenT2(ConsumerRecord<?, ?> cr) throws Exception {
        logger.info("{} - {} : {}", cr.topic(), cr.key(), cr.value());
    }
}
